﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/MasterPages/Core.Master"
    CodeBehind="AssociationExpenses.aspx.cs" Title="Association Expenses" Inherits="Pap.Web.Modules.Loan.Views.AssociationExpenses"
    meta:resourcekey="PageResource1" %>

<asp:Content runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <ext:Store runat="server" ID="storeAssociationExpenses" AutoLoad="True" IDMode="Legacy"
        meta:resourcekey="storeAssociationExpensesResource1" SerializationMode="Simple">
        <Reader>
            <ext:JsonReader>
                <Fields>
                    <ext:RecordField Name="WithdrawDate">
                        <Convert Handler="" Args="value,record" FormatHandler="False"></Convert>
                    </ext:RecordField>
                    <ext:RecordField Name="WithdrawAmount">
                        <Convert Handler="" Args="value,record" FormatHandler="False"></Convert>
                    </ext:RecordField>
                    <ext:RecordField Name="WithdrawCheckNumber">
                        <Convert Handler="" Args="value,record" FormatHandler="False"></Convert>
                    </ext:RecordField>
                    <ext:RecordField Name="Notes">
                        <Convert Handler="" Args="value,record" FormatHandler="False"></Convert>
                    </ext:RecordField>
                    <ext:RecordField Name="ProjectName" />
                </Fields>
            </ext:JsonReader>
        </Reader>
        <SortInfo Direction="ASC"></SortInfo>
    </ext:Store>
    <ext:Store runat="server" ID="storeProjects" AutoLoad="True" IDMode="Legacy" meta:resourcekey="storeProjectsResource1"
        SerializationMode="Simple">
        <Reader>
            <ext:JsonReader ReaderID="ProjectID">
                <Fields>
                    <ext:RecordField Name="ProjectID" />
                    <ext:RecordField Name="ProjectName" />
                </Fields>
            </ext:JsonReader>
        </Reader>
        <SortInfo Direction="ASC"></SortInfo>
    </ext:Store>
    <ext:FitLayout runat="server" meta:resourcekey="FitLayoutResource1">
        <ext:Panel runat="server" AutoScroll="true" meta:resourcekey="PanelResource1">
            <Body>
                <ext:FitLayout runat="server">
                    <ext:GridPanel runat="server" ID="gridAssociationExpenses" StoreID="storeAssociationExpenses"
                        Frame="true" AutoExpandColumn="Notes" Title="Association Expenses" AutoWidth="True"
                        meta:resourcekey="gridAssociationExpensesResource1" StripeRows="true">
                        <ColumnModel>
                            <Columns>
                                <ext:Column DataIndex="ProjectName" Header="<%$ Resources:ProjectName %>" />
                                <ext:Column DataIndex="WithdrawDate" Header="<%$ Resources:HeaderWithdrawdate %>"
                                    Sortable="True">
                                    <PrepareCommand Args="grid,command,record,row,col,value" FormatHandler="False" Handler="" />
                                    <PrepareCommands Args="grid,commands,record,row,col,value" FormatHandler="False"
                                        Handler="" />
                                    <Renderer Fn="Ext.util.Format.dateRenderer('d/m/Y')" />
                                </ext:Column>
                                <ext:Column DataIndex="WithdrawAmount" Header="<%$ Resources:HeaderWithdrawAmount %>"
                                    Sortable="True">
                                    <PrepareCommand Args="grid,command,record,row,col,value" FormatHandler="False" Handler="" />
                                    <PrepareCommands Args="grid,commands,record,row,col,value" FormatHandler="False"
                                        Handler="" />
                                </ext:Column>
                                <ext:Column DataIndex="WithdrawCheckNumber" Header="<%$ Resources:HeaderWithdrawCheckNumber %>"
                                    Sortable="True">
                                    <PrepareCommand Args="grid,command,record,row,col,value" FormatHandler="False" Handler="" />
                                    <PrepareCommands Args="grid,commands,record,row,col,value" FormatHandler="False"
                                        Handler="" />
                                </ext:Column>
                                <ext:Column DataIndex="Notes" Header="<%$ Resources:HeaderNotes %>" Sortable="True">
                                    <PrepareCommand Args="grid,command,record,row,col,value" FormatHandler="False" Handler="" />
                                    <PrepareCommands Args="grid,commands,record,row,col,value" FormatHandler="False"
                                        Handler="" />
                                </ext:Column>
                            </Columns>
                        </ColumnModel>
                        <SelectionModel>
                            <ext:RowSelectionModel>
                            </ext:RowSelectionModel>
                        </SelectionModel>
                        <BottomBar>
                            <ext:PagingToolbar ID="pagingBar" runat="server" StoreID="storeAssociationExpenses"
                                PageSize="15" DisplayInfo="True" IDMode="Static" meta:resourcekey="pagingBarResource1">
                            </ext:PagingToolbar>
                        </BottomBar>
                        <TopBar>
                            <ext:Toolbar runat="server">
                                <Items>
                                    <ext:Button runat="server" Icon="MoneyDelete" Text="New Expenses Item">
                                        <AjaxEvents>
                                            <Click OnEvent="BtnNewExpenses_Click">
                                                <EventMask ShowMask="true" />
                                            </Click>
                                        </AjaxEvents>
                                    </ext:Button>
                                </Items>
                            </ext:Toolbar>
                        </TopBar>
                    </ext:GridPanel>
                </ext:FitLayout>
            </Body>
            <BottomBar>
                <ext:StatusBar runat="server">
                    <Items>
                        <ext:Button runat="server" IDMode="Static" ID="btnBack" Text="<%$ Resources:BackButton %>"
                            Icon="ArrowUndo">
                            <AjaxEvents>
                                <Click OnEvent="btnBack_Clicked" />
                            </AjaxEvents>
                        </ext:Button>
                    </Items>
                </ext:StatusBar>
            </BottomBar>
        </ext:Panel>
    </ext:FitLayout>
    <ext:Window runat="server" ID="uxExpensesWindow" ShowOnLoad="false" Width="600" Modal="true"
        AutoHeight="true" meta:resourcekey="panelDataResource1">
        <Body>
            <ext:FormPanel runat="server" ID="panelData" IDMode="Static" ElementStyle="" Frame="true">
                <Body>
                    <ext:FormLayout ID="FormLayout1" runat="server" ElementStyle="" ItemCls="" meta:resourcekey="FormLayoutResource1">
                        <ext:Anchor Horizontal="95%">
                            <ext:TextField runat="server" ID="txtAssociationName" FieldLabel="AssociationName"
                                Disabled="True" AllowBlank="False" meta:resourcekey="txtAssociationNameResource1" />
                        </ext:Anchor>
                        <ext:Anchor Horizontal="95%">
                            <ext:TextField runat="server" ID="txtAssociationBalance" Disabled="true" AllowBlank="false"
                                meta:resourcekey="txtAssociationBalanceResource1">
                            </ext:TextField>
                        </ext:Anchor>
                        <ext:Anchor Horizontal="95%">
                            <ext:ComboBox ValueField="ProjectID" FieldLabel="Project" DisplayField="ProjectName"
                                runat="server" ID="cmbProjects" meta:resourcekey="cmbProjectsResource" StoreID="storeProjects"
                                Editable="False" AllowBlank="False" TriggerAction="All">
                            </ext:ComboBox>
                        </ext:Anchor>
                        <ext:Anchor Horizontal="95%">
                            <ext:DateField runat="server" ID="dateWithdrawDate" FieldLabel="WithdrawDate" AllowBlank="False"
                                MaxDate="" meta:resourcekey="dateWithdrawDateResource1" MinDate="" SelectedDate="" />
                        </ext:Anchor>
                        <ext:Anchor Horizontal="95%">
                            <ext:NumberField runat="server" ID="txtWithdrawAmount" FieldLabel="WithdrawAmount"
                                AllowNegative="False" MinValue="0" AllowBlank="False" meta:resourcekey="txtWithdrawAmountResource1" />
                        </ext:Anchor>
                        <ext:Anchor Horizontal="95%">
                            <ext:TextField runat="server" ID="txtWithdrawCheckNumber" FieldLabel="WithdrawCheckNumber"
                                AllowBlank="False" Regex="^[0-9A-z]+$" MaxLength="20" meta:resourcekey="txtWithdrawCheckNumberResource1"
                                Text="" />
                        </ext:Anchor>
                        <ext:Anchor Horizontal="95%">
                            <ext:TextArea runat="server" ID="txtNotes" FieldLabel="Notes" meta:resourcekey="txtNotesResource1"
                                Text="" />
                        </ext:Anchor>
                    </ext:FormLayout>
                </Body>
                <BottomBar>
                    <ext:StatusBar Flat="true" runat="server">
                        <Plugins>
                            <ext:ValidationStatus ID="wndpnlValidation" FormPanelID="panelData" ValidIcon="Accept"
                                ErrorIcon="Exclamation" runat="server" meta:resourcekey="pnlValidationResource1" />
                        </Plugins>
                    </ext:StatusBar>
                </BottomBar>
            </ext:FormPanel>
        </Body>
        <BottomBar>
            <ext:StatusBar runat="server" DefaultText="" IDMode="Static" meta:resourcekey="StatusBarResource1">
                <Items>
                    <ext:Button runat="server" ID="btnWithdraw" Text="Withdraw" Icon="MoneyDelete"
                        IDMode="Static" meta:resourcekey="btnWithdrawResource1">
                        <AjaxEvents>
                            <Click OnEvent="BtnWithdraw_Clicked" Before="return Ext.getCmp('panelData').getForm().isValid();">
                                <EventMask ShowMask="True" />
                            </Click>
                        </AjaxEvents>
                    </ext:Button>
                </Items>
            </ext:StatusBar>
        </BottomBar>
    </ext:Window>
</asp:Content>
